package main

import "fmt"

// int float 基本数据类型，可以可以转换, string 需要断言
func main() {
	var a interface{}

	b := 1.1
	fmt.Printf("b vlaue is %v, type is %[1]T\n", b) // b vlaue is 1.1, type is float64

	a = b
	fmt.Printf("a vlaue is %v, type is %[1]T\n", a) // a vlaue is 1.1, type is float64

	b2 := a
	fmt.Printf("b2 vlaue is %v, type is %[1]T\n", b2)

	fmt.Println("test string------------------")

	str := "hello"
	a = str
	fmt.Printf("a vlaue is %v, type is %[1]T\n", a)

	var str3 string = a.(string)
	fmt.Printf("str3 vlaue is %v, type is %[1]T\n", str3)
}
